package com.example.securitymy.controller;

import com.example.securitymy.domain.ResponseResult;
import com.example.securitymy.domain.User;
import com.example.securitymy.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RegisterController {

    @Autowired
    private RegisterService registerService;

    @PostMapping("/user/register")
    public ResponseResult register(@RequestBody User user) {
        System.out.println("=================注册用户============");
        System.out.println(user);
        return registerService.register(user);
    }
}